//package wyh.controller.User;
//
//import com.fasterxml.jackson.databind.ObjectMapper;
//import wyh.pojo.User;
//import wyh.service.UserService;
//import wyh.vo.Result;
//
//import javax.servlet.ServletException;
//import javax.servlet.annotation.WebServlet;
//import javax.servlet.http.HttpServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//import java.util.List;
//
//@WebServlet("/User/SelectByName")
//public class SelectByNameLikeServlet2 extends HttpServlet {
//
//    @Override
//    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//
//        System.out.println("SelectByNameLikeServlet");
//        ObjectMapper ojmapper = new ObjectMapper();
//        String like = ojmapper.readValue(req.getInputStream(), String.class);
//        System.out.println(like);
//        UserService service = new UserService();
//        List<User> list = service.ServicegetByNameLike(like);
//        Result result = null;
//        if (list.size()!=0) {
//            result = new Result(200, "查询到"+list.size()+"条信息", null);
//        } else {
//            result = new Result(500, "未查询到该模糊关键词", null);
//        }
//        String string = ojmapper.writeValueAsString(result);
//        resp.setContentType("application/json;charset=utf-8");
//        resp.getWriter().write(string);
//    }
//}